<!--#Include File="../conn.asp" -->
<!--#Include File="comm/inc.asp" -->
<%
'====================================================================
'= Team Elite - Elite Article System
'= Copyright (c) 2005 - 2006 Eason Chan All Rights Reserved.
'=-------------------------------------------------------------------
'= 版权协议：
'=	GPL (The GNU GENERAL PUBLIC LICENSE Version 2, June 1991)
'=-------------------------------------------------------------------
'= 文件名称：/Manager/Admin_Config.asp
'= 摘    要：后台-系统设定文件
'=-------------------------------------------------------------------
'= 最后更新：eason007
'= 最后日期：2006-03-27
'====================================================================

Call EA_Manager.Chk_IsMaster

If Not EA_Manager.Chk_Power(Admin_Power,"01") Then 
	ErrMsg=str_Comm_NotAccess
	Call EA_Manager.Error(1)
End If

Dim Setting,Action

Action=Request.QueryString ("atcion")
Select Case LCase(Action)
Case "save"
	Call Save
Case Else 
	Call Main
End Select
Call EA_Pub.Close_Obj
Set EA_Pub=Nothing

Sub Main
	Dim Tmp,TempStr,Source,BadWord
	Dim Temp
	
	Temp=EA_DBO.Get_System_Info()
	If IsArray(Temp) Then 
		If Temp(5,0)<>"" And Not IsNull(Temp(5,0)) Then 
			Tmp=Split(Temp(5,0),",")
			TempStr=Temp(5,0)
			Source=Temp(6,0)
			BadWord=Temp(7,0)

			If Ubound(Tmp)<26 Then 
				TempStr=TempStr&",,,,,,,,,,,,,,,,,,,,,,,,"
				Tmp=Split(TempStr,",")
			End If

			Setting=Tmp
		End If
	End If

	PageContent=Template.LoadTemplate("admin_config.htm")

	Template.SetVariable "Language_OperationNotice",str_OperationNotice,PageContent
	
	Template.SetVariable "Language_Comm_Yes",str_Comm_Yes,PageContent
	Template.SetVariable "Language_Comm_No",str_Comm_No,PageContent
	Template.SetVariable "Language_Comm_Save_Button",str_Comm_Save_Button,PageContent
	Template.SetVariable "Language_Comm_Reset_Button",str_Comm_Reset_Button,PageContent

	Template.SetVariable "Language_Content_CutArticle_Not",str_Content_CutArticle_Not,PageContent
	Template.SetVariable "Language_Content_CutArticle_Auto",str_Content_CutArticle_Auto,PageContent
	Template.SetVariable "Language_Content_CutArticle_Manual",str_Content_CutArticle_Manual,PageContent

	Template.SetVariable "Language_Config_Help",str_Config_Help,PageContent
	Template.SetVariable "Language_Config_Base",str_Config_Base,PageContent
	Template.SetVariable "Language_Config_WebSiteName",str_Config_WebSiteName,PageContent
	Template.SetVariable "Language_Config_WebSiteURL",str_Config_WebSiteURL,PageContent
	Template.SetVariable "Language_Config_WebSiteState",str_Config_WebSiteState,PageContent
	Template.SetVariable "Language_Config_WebSiteState_Open",str_Config_WebSiteState_Open,PageContent
	Template.SetVariable "Language_Config_WebSiteState_Close",str_Config_WebSiteState_Close,PageContent
	Template.SetVariable "Language_Config_ClosedMsg",str_Config_ClosedMsg,PageContent
	Template.SetVariable "Language_Config_SystemTimer",str_Config_SystemTimer,PageContent
	Template.SetVariable "Language_Config_SystemTimer_Value",str_Config_SystemTimer_Value,PageContent
	Template.SetVariable "Language_Config_SystemTimer_Value_Help",str_Config_SystemTimer_Value_Help,PageContent
	Template.SetVariable "Language_Config_PageKeyWord",str_Config_PageKeyWord,PageContent
	Template.SetVariable "Language_Config_PageKeyWord_Help",str_Config_PageKeyWord_Help&"",PageContent
	Template.SetVariable "Language_Config_PageDescription",str_Config_PageDescription,PageContent
	Template.SetVariable "Language_Config_PageDescription_Help",str_Config_PageDescription_Help,PageContent
	Template.SetVariable "Language_Config_SystemMode",str_Config_SystemMode,PageContent
	Template.SetVariable "Language_Config_SystemStyle",str_Config_SystemStyle,PageContent
	Template.SetVariable "Language_Config_SystemIndexMode",str_Config_SystemIndexMode,PageContent
	Template.SetVariable "Language_Config_Article",str_Config_Article,PageContent
	Template.SetVariable "Language_Config_ManagerEditor",str_Config_ManagerEditor,PageContent
	Template.SetVariable "Language_Config_MemberEditor",str_Config_MemberEditor,PageContent
	Template.SetVariable "Language_Config_AutoRemote",str_Config_AutoRemote,PageContent
	Template.SetVariable "Language_Config_AutoRemote_Help",str_Config_AutoRemote_Help,PageContent
	Template.SetVariable "Language_Content_CutArticle",str_Content_CutArticle,PageContent
	Template.SetVariable "Language_Config_PageSize",str_Config_PageSize,PageContent
	Template.SetVariable "Language_Config_DefaultPoster",str_Config_DefaultPoster,PageContent
	Template.SetVariable "Language_Config_Reg",str_Config_Reg,PageContent
	Template.SetVariable "Language_Config_UserRegEnable",str_Config_UserRegEnable,PageContent
	Template.SetVariable "Language_Config_EmailById",str_Config_EmailById,PageContent
	Template.SetVariable "Language_Config_RegWaitAdmin",str_Config_RegWaitAdmin,PageContent
	Template.SetVariable "Language_Config_EMail",str_Config_EMail,PageContent
	Template.SetVariable "Language_Config_EMailAddress",str_Config_EMailAddress,PageContent
	Template.SetVariable "Language_Config_SMTPServerAddress",str_Config_SMTPServerAddress,PageContent
	Template.SetVariable "Language_Config_SMTPLoginAccout",str_Config_SMTPLoginAccout,PageContent
	Template.SetVariable "Language_Config_SMTPLoginPassWord",str_Config_SMTPLoginPassWord,PageContent
	Template.SetVariable "Language_Config_Other",str_Config_Other,PageContent
	Template.SetVariable "Language_Config_GhostPostReview",str_Config_GhostPostReview,PageContent
	Template.SetVariable "Language_Config_ReviewWaitAdmin",str_Config_ReviewWaitAdmin,PageContent
	Template.SetVariable "Language_Config_GhostPostVote",str_Config_GhostPostVote,PageContent
	Template.SetVariable "Language_Config_BadWord",str_Config_BadWord,PageContent
	Template.SetVariable "Language_Config_BadWord_Help",str_Config_BadWord_Help,PageContent
	Template.SetVariable "Language_Config_ArticleFrom",str_Config_ArticleFrom,PageContent
	Template.SetVariable "Language_Config_ArticleFrom_Help",str_Config_ArticleFrom_Help,PageContent
	

	Template.SetVariable "Setting_0",Setting(0),PageContent
	OptionReplace Setting,1,"radio",PageContent
	Template.SetVariable "Setting_2",Setting(2),PageContent
	OptionReplace Setting,3,"radio",PageContent
	Template.SetVariable "Setting_4",Setting(4),PageContent
	OptionReplace Setting,5,"select",PageContent
	Template.SetVariable "Setting_6",Setting(6),PageContent
	OptionReplace Setting,7,"radio",PageContent
	OptionReplace Setting,8,"radio",PageContent
	OptionReplace Setting,9,"radio",PageContent
	OptionReplace Setting,10,"radio",PageContent
	Template.SetVariable "Setting_11",Setting(11),PageContent
	Template.SetVariable "Setting_12",Setting(12),PageContent
	Template.SetVariable "Setting_13",Setting(13),PageContent
	Template.SetVariable "Setting_14",Setting(14),PageContent
	Template.SetVariable "Setting_15",Setting(15),PageContent
	Template.SetVariable "Setting_16",Setting(16),PageContent
	Template.SetVariable "Setting_17",Setting(17),PageContent
	OptionReplace Setting,18,"radio",PageContent
	OptionReplace Setting,19,"radio",PageContent
	OptionReplace Setting,20,"radio",PageContent
	Template.SetVariable "Setting_21",Setting(21),PageContent
	OptionReplace Setting,22,"radio",PageContent
	OptionReplace Setting,23,"select",PageContent
	OptionReplace Setting,24,"select",PageContent
	OptionReplace Setting,25,"radio",PageContent
	OptionReplace Setting,26,"radio",PageContent

	Template.SetVariable "BadWord",BadWord,PageContent
	Template.SetVariable "Source",Source,PageContent


	Template.BaseReplace PageContent
	Template.OutStr PageContent
End Sub

Sub OptionReplace(ByRef vArray,ByRef iIndex,ByRef sType,ByRef sPageContent)
	Select Case LCase(sType)
	Case "radio","checkbox"
		Template.SetVariable "Setting_" & iIndex & "_" & vArray(iIndex)," checked",PageContent
	Case "select"
		Template.SetVariable "Setting_" & iIndex & "_" & vArray(iIndex)," selected",PageContent
	End Select
End Sub

Sub Save
	Call EA_Pub.Chk_Post

	Dim Source,BadWord
	Dim SiteUrl
	
	SiteUrl=EA_Pub.SafeRequest(2,"url",1,"",0)
	If Right(SiteUrl,1)<>"/" And Right(SiteUrl,1)<>"\" Then SiteUrl=SiteUrl&"/"
	Source=EA_Pub.SafeRequest(2,"source",1,"",1)
	If Right(Source,1)=";" Then Source=Left(Source,Len(Source)-1)
	BadWord=EA_Pub.SafeRequest(2,"badword",1,"",1)
	If Right(BadWord,1)=";" Then BadWord=Left(BadWord,Len(BadWord)-1)

	Setting=EA_Pub.SafeRequest(2,"name",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"isopen",0,1,0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"message",1,"",0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"isclose",0,0,0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"opentime",1,"1|23",-1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"cutpage",0,0,0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"cutarticle",0,0,0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"isreg",0,1,0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"isemail",0,1,0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"isadmin",0,0,0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"isvote",0,1,0)&","
	Setting=Setting&SiteUrl&","
	Setting=Setting&EA_Pub.SafeRequest(2,"mail",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"mail_n",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"mail_p",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"mail_s",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"keyword",1,"",1)&","
	Setting=Setting&Replace(EA_Pub.SafeRequest(2,"description",1,"",1),",","，")&","
	Setting=Setting&EA_Pub.SafeRequest(2,"skin",0,1,1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"isreview",0,1,1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"isreview_admin",0,0,1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"author",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"autoremote",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"master_editor",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"member_editor",1,"",1)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"debug",1,"",0)&","
	Setting=Setting&EA_Pub.SafeRequest(2,"index",1,"",0)&","
	
	SQL="UpDate [NB_System] Set Info='"&Setting&"',Source='"&Source&"',BadWord='"&BadWord&"'"
	Conn.Execute(SQL)

	Setting = Split(Setting,",")
	Setting(14) = ""
	Setting = Join(Setting,",")
	
	Call EA_Ini.WriteNode("System","Info",Setting)
	EA_Ini.Save

	Call EA_Pub.Close_Obj
	Set EA_Pub=Nothing
	
	Response.Redirect Request.ServerVariables("HTTP_REFERER")
End Sub
%>
